# -*- coding: utf-8 -*-
# @Time    : 2019/9/26 13:34
# @Author  : LiHaowen
# @Email   : lihaowen2017@163.com
# @File    : forms.py

from django import forms

from web_ask.articles.models import Article
from markdownx.fields import MarkdownxFormField


class ArticleForm(forms.ModelForm):
    status = forms.CharField(widget=forms.HiddenInput())  # 隐藏
    edited = forms.BooleanField(widget=forms.HiddenInput(), initial=False, required=False)
    content = MarkdownxFormField()

    class Meta:
        model = Article
        fields = ["title", "content", "image", "tags", "status", "edited"]
